export enum DataType {
  int = 'int',
  float = 'float',
  enum = 'enum',
  bool = 'bool',
  text = 'text',
  date = 'date',
  array = 'array',
  string = 'string',
  bytes = 'bytes',
  bits = 'bits',
  _16int = '16int',
  _16uint = '16uint',
  _16float = '16float',
  _32int = '32int',
  _32uint = '32uint',
  _32float = '32float',
  _64int = '64int',
  _64uint = '64uint',
  _64float = '64float',

  WORD = 'word',
  DWORD = 'dword',
  REAL = 'real',
  TIME = 'time',
  S5TIME = 's5time',
  DT = 'dt',
  UNIT = 'uint',
  DINT = 'dint',
  UDINT = 'udint',
  BYTE = 'byte',
}

export const mainserachstate = [
  {
    label: '在线',
    value: 1,
  },
  {
    label: '离线',
    value: 0,
  },
];

export const state = [
  {
    label: '在线',
    value: 1,
  },
  {
    label: '离线',
    value: 0,
  },
  {
    label: '未知',
    value: 2,
  },
];

export const LogOption = [
  {
    label: '发送',
    value: 'send',
  },
  {
    label: '保存',
    value: 'save',
  },
  {
    label: '接收',
    value: 'recv',
  },
  {
    label: '信息',
    value: 'info',
  },
  {
    label: '调试',
    value: 'debug',
  },
  {
    label: '警告',
    value: 'warning',
  },
  {
    label: '异常',
    value: 'error',
  },
  {
    label: '报错',
    value: 'exception',
  },
];

export const DataTypeOption = [
  {
    label: DataType.int,
    value: DataType.int,
    key: DataType.int,
  },
  {
    label: DataType.float,
    value: DataType.float,
    key: DataType.float,
  },

  {
    label: DataType.enum,
    value: DataType.enum,
    key: DataType.enum,
  },
  {
    label: DataType.bool,
    value: DataType.bool,
    key: DataType.bool,
  },
  {
    label: DataType.text,
    value: DataType.text,
    key: DataType.text,
  },
  {
    label: DataType.date,
    value: DataType.date,
    key: DataType.date,
  },
  {
    label: DataType.array,
    value: DataType.array,
    key: DataType.array,
  },
  {
    label: DataType.string,
    value: DataType.string,
    key: DataType.string,
  },
  {
    label: DataType.bytes,
    value: DataType.bytes,
    key: DataType.bytes,
  },
  {
    label: DataType.bits,
    value: DataType.bits,
    key: DataType.bits,
  },
  {
    label: DataType._16int,
    value: DataType._16int,
    key: DataType._16int,
  },
  {
    label: DataType._16uint,
    value: DataType._16uint,
    key: DataType._16uint,
  },
  {
    label: DataType._16float,
    value: DataType._16float,
    key: DataType._16float,
  },
  {
    label: DataType._32int,
    value: DataType._32int,
    key: DataType._32int,
  },
  {
    label: DataType._32uint,
    value: DataType._32uint,
    key: DataType._32uint,
  },
  {
    label: DataType._32float,
    value: DataType._32float,
    key: DataType._32float,
  },
  {
    label: DataType._64int,
    value: DataType._64int,
    key: DataType._64int,
  },
  {
    label: DataType._64uint,
    value: DataType._64uint,
    key: DataType._64uint,
  },
  {
    label: DataType._64float,
    value: DataType._64float,
    key: DataType._64float,
  },

  {
    label: DataType.WORD,
    value: DataType.WORD,
    key: DataType.WORD,
  },
  {
    label: DataType.DWORD,
    value: DataType.DWORD,
    key: DataType.DWORD,
  },
  {
    label: DataType.REAL,
    value: DataType.REAL,
    key: DataType.REAL,
  },
  {
    label: DataType.TIME,
    value: DataType.TIME,
    key: DataType.TIME,
  },
  {
    label: DataType.S5TIME,
    value: DataType.S5TIME,
    key: DataType.S5TIME,
  },
  {
    label: DataType.DT,
    value: DataType.DT,
    key: DataType.DT,
  },
  {
    label: DataType.UNIT,
    value: DataType.UNIT,
    key: DataType.UNIT,
  },
  {
    label: DataType.DINT,
    value: DataType.DINT,
    key: DataType.DINT,
  },
  {
    label: DataType.UDINT,
    value: DataType.UDINT,
    key: DataType.UDINT,
  },
  {
    label: DataType.BYTE,
    value: DataType.BYTE,
    key: DataType.BYTE,
  },
];

export enum FunctionCode {
  f1 = '1',
  f2 = '2',
  f3 = '3',
  f4 = '4',
}
export const FunctionCodeOption = [
  {
    label: '(0x01)',
    value: FunctionCode.f1,
    key: FunctionCode.f1,
  },
  {
    label: '(0x02)',
    value: FunctionCode.f2,
    key: FunctionCode.f2,
  },
  {
    label: '(0x03)',
    value: FunctionCode.f3,
    key: FunctionCode.f3,
  },
  {
    label: '(0x04)',
    value: FunctionCode.f4,
    key: FunctionCode.f4,
  },
];

export enum ReadType {
  onlyRead = 1,
  onlyWhite = 2,
  readWhite = 3,
}
export const ReadTypeList = [
  {
    label: '只读',
    value: ReadType.onlyRead,
    key: ReadType.onlyRead,
  },
  {
    label: '只写',
    value: ReadType.onlyWhite,
    key: ReadType.onlyWhite,
  },
  {
    label: '读写',
    value: ReadType.readWhite,
    key: ReadType.readWhite,
  },
];
